//package com.demo.order.config;
//
//import org.springframework.context.annotation.Bean;
//import org.springframework.context.annotation.Configuration;
//import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry;
//import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
//import springfox.documentation.builders.ApiInfoBuilder;
//import springfox.documentation.builders.PathSelectors;
//import springfox.documentation.builders.RequestHandlerSelectors;
//import springfox.documentation.service.ApiInfo;
//import springfox.documentation.spi.DocumentationType;
//import springfox.documentation.spring.web.plugins.Docket;
//import springfox.documentation.swagger2.annotations.EnableSwagger2WebMvc;
//
///**
// * @className: com.demo.account.config-> SwaggerConfiguration
// * @description:
// * @author: wuyijie
// * @createDate: 2021/5/19 0:19
// */
//@Configuration
//@EnableSwagger2WebMvc
//public class SwaggerConfiguration implements WebMvcConfigurer {
//
//    @Bean
//    public Docket createRestApi(){
//        return new Docket(DocumentationType.SWAGGER_2)
//                .apiInfo(apiInfo())
//                .select()
//                .apis(RequestHandlerSelectors.basePackage("com.macro.cloud.controller"))
//                .paths(PathSelectors.any())
//                .build();
//    }
//
//    private ApiInfo apiInfo() {
//        return new ApiInfoBuilder()
//                .title("micro-knife4j-account")
//                .description("account服务API文档")
//                .contact("macro")
//                .version("1.0")
//                .build();
//    }
//
//
////    @Bean(value = "userApi")
////    @Order(value = 1)
////    public Docket groupRestApi() {
////        return new Docket(DocumentationType.SWAGGER_2)
////                .apiInfo(groupApiInfo())
////                .select()
//////                .apis(RequestHandlerSelectors.any())
////                .apis(RequestHandlerSelectors.basePackage("com.demo.account.controller"))
////                .paths(PathSelectors.any())
////                .build();
////    }
////
////    private ApiInfo groupApiInfo(){
////        return new ApiInfoBuilder()
////                .title("swagger好用！！！")
////                .description("<div style='font-size:14px;color:red;'>swagger-bootstrap-ui-demo RESTful APIs</div>")
////                .termsOfServiceUrl("http://www.group.com/")
////                .contact(new Contact("aa","bb","cc"))
////                .version("1.0")
////                .build();
////    }
////
////    private ApiKey apiKey() {
////        return new ApiKey("BearerToken", "Authorization", "header");
////    }
////    private ApiKey apiKey1() {
////        return new ApiKey("BearerToken1", "Authorization-x", "header");
////    }
////
////    private SecurityContext securityContext() {
////        return SecurityContext.builder()
////                .securityReferences(defaultAuth())
////                .forPaths(PathSelectors.regex("/.*"))
////                .build();
////    }
////    private SecurityContext securityContext1() {
////        return SecurityContext.builder()
////                .securityReferences(defaultAuth1())
////                .forPaths(PathSelectors.regex("/.*"))
////                .build();
////    }
////
////    List<SecurityReference> defaultAuth() {
////        AuthorizationScope authorizationScope = new AuthorizationScope("global", "accessEverything");
////        AuthorizationScope[] authorizationScopes = new AuthorizationScope[1];
////        authorizationScopes[0] = authorizationScope;
////        return Lists.newArrayList(new SecurityReference("BearerToken", authorizationScopes));
////    }
////    List<SecurityReference> defaultAuth1() {
////        AuthorizationScope authorizationScope = new AuthorizationScope("global", "accessEverything");
////        AuthorizationScope[] authorizationScopes = new AuthorizationScope[1];
////        authorizationScopes[0] = authorizationScope;
////        return Lists.newArrayList(new SecurityReference("BearerToken1", authorizationScopes));
////    }
//
//
//    @Override
//    public void addResourceHandlers(ResourceHandlerRegistry registry) {
//        registry.addResourceHandler("doc.html").addResourceLocations("classpath:/META-INF/resources/");
//        registry.addResourceHandler("/webjars/**").addResourceLocations("classpath:/META-INF/resources/webjars/");
//    }
//}
